//提前定义好打印模板  barcodeData，count字段为自定义数据字段，需传入动态数据  panel.js
export default function (qrcode) {
  return {
    panels: [
      {
        index: 0,
        height: 60,
        width: 80,
        paperHeader: 0, // 页眉线位置  单位pt
        paperFooter: 0, // 页脚线位置  单位pt
        printElements: [
          {
            options: {
              left: 64.5,
              top: 12,
              height: 17,
              width: 100,
              testData: "源之创",
              fontSize: 16,
              fontWeight: "700",
              textAlign: "center",
              hideTitle: true,
              title: "源之创",
            },
            printElementType: { title: "源之创", type: "text" },
          },
          {
            options: {
              left: 64.5,
              top: 32,
              height: 100,
              width: 100,
              testData: String(
                import.meta.env.VITE_APP_H5_CODE_API +
                  (qrcode || "CF202410270006")
              ),
              fontSize: 12,
              lineHeight: 18,
              fontWeight: "700",
              textAlign: "left",
              textContentVerticalAlign: "middle",
              textType: "qrcode",
              field: "qrcodeData",
              title: "二维码",
              hideTitle: true,
            },
            printElementType: { title: "二维码", type: "text" },
          },
          {
            options: {
              left: 64.5,
              top: 135,
              height: 16,
              width: 100,
              testData: qrcode || "CF202410270006",
              fontSize: 10,
              fontWeight: "700",
              textAlign: "center",
              hideTitle: true,
              title: qrcode || "CF202410270006",
              field: "qrcodeText",
            },
            printElementType: {
              title: qrcode || "CF202410270006",
              type: "text",
            },
          },
        ],
        // paperNumberLeft: 196,
        // paperNumberTop: 148,
        paperNumberDisabled: true,
        paperNumberFormat: "paperNo-paperCount",
      },
    ],
  };
}
